% TEST_ID: LANG-EXPAND-0082
% CATEGORY: stdlib/arithmetic_ops/bitops
% 测试 bitxor 函数
function test_bit_bitxor()
A = uint8([0 1; 0 1]);
B = uint8([0 0; 1 1]);
TTable = bitxor(A, B);
assert(isequal(TTable, [0 1; 1 0]));
assert(isa(TTable, 'uint8'));

a = -5;
a1 = bitget(a,8:-1:1,'int8');
assert(isequal(a1, [1 1 1 1 1 0 1 1]));

b = 6;
b1 = bitget(b,8:-1:1,'int8');
assert(isequal(b1, [0 0 0 0 0 1 1 0]));

c = bitxor(a,b,'int8');
assert(c == -3);
c1 = bitget(c,8:-1:1,'int8');
assert(isequal(c1, [1 1 1 1 1 1 0 1]));

r = bitxor(false, false);
assert(r == false);
assert(class(r) == 'logical');